import request from '@/utils/request'

// 查询焊缝探伤信息列表
export function listSeamRate(query) {
  return request({
    url: '/quality/seamRate/list',
    method: 'get',
    params: query
  })
}

// 查询半年焊缝列表
export function getRecentHalfYearSeam(query) {
  return request({
    url: '/quality/seamRate/getRecentHalfYearSeam',
    method: 'get',
    params: query
  })
}

// 计算指定条件下的焊缝总长、缺陷总长和相应合格率
export function calculateSeamRate(query) {
  return request({
    url: '/quality/seamRate/calculateSeamRate',
    method: 'get',
    params: query
  })
}

// 查询焊缝探伤信息详细
export function getSeamRate(id) {
  return request({
    url: '/quality/seamRate/' + id,
    method: 'get'
  })
}

// 新增焊缝探伤信息
export function addSeamRate(data) {
  return request({
    url: '/quality/seamRate',
    method: 'post',
    data: data
  })
}

// 修改焊缝探伤信息
export function updateSeamRate(data) {
  return request({
    url: '/quality/seamRate',
    method: 'put',
    data: data
  })
}

// 删除焊缝探伤信息
export function delSeamRate(id) {
  return request({
    url: '/quality/seamRate/' + id,
    method: 'delete'
  })
}
